home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / PCHDT_E3.CAB / DFS05.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2003-02-21  |  11.5 KB  |  435 lines

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet type="text/xsl" href="xmldisplay.xsl"?>
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
  4.                 xmlns:dt="urn:schemas-microsoft-com:datatypes"
  5.                 xmlns:d2="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
  6.     <xsl:template match="/">
  7.         <html>
  8.             <head>
  9.                 <meta http-equiv="Content-Type" content="text/html; CHARSET=windows-1252" />
  10.                 <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l comment "RSACi North America Server" by "inet@microsoft.com" r (n 0 s 0 v 0 l 0))' />
  11.                 <meta http-equiv="MSThemeCompatible" content="Yes" />
  12.                 <style type="text/css">
  13.                     body 
  14.                     { 
  15.                         font-family:Tahoma;
  16.                         font-size:8pt; 
  17.                         padding:3px;
  18.                     }
  19.  
  20.                     .c  
  21.                     {
  22.                         cursor:hand;
  23.                     }
  24.  
  25.                     .b  
  26.                     {
  27.                         color:red; 
  28.                         font-family:Courier New; 
  29.                         font-weight:bold; 
  30.                         text-decoration:none;
  31.                     }
  32.  
  33.                     .e  
  34.                     {
  35.                         margin-left:1em; 
  36.                         text-indent:-1em; 
  37.                         margin-right:1em;
  38.                     }
  39.  
  40.                     .k  
  41.                     {
  42.                         margin-left:1em; 
  43.                         text-indent:-1em; 
  44.                         margin-right:1em;
  45.                     }
  46.  
  47.                     .t  
  48.                     {
  49.                         color:#990000;
  50.                     }
  51.  
  52.                     .xt 
  53.                     {
  54.                         xcolor:#990099;
  55.                     }
  56.  
  57.                     .ns 
  58.                     {
  59.                         color:red;
  60.                     }
  61.  
  62.                     .dt 
  63.                     {
  64.                         color:green;
  65.                     }
  66.  
  67.                     .tx 
  68.                     {
  69.                         font-weight:bold;
  70.                     }
  71.  
  72.                     .db 
  73.                     {
  74.                         text-indent:0px; 
  75.                         margin: 0em 1em 0em 1em;
  76.                         padding:0em .3em 0em .3em; 
  77.                         border-left:1px solid #CCCCCC; 
  78.                         font:small Courier
  79.                     }
  80.  
  81.                     .di 
  82.                     {
  83.                         font:small Courier;
  84.                     }
  85.  
  86.                     .d, .pi, .m
  87.                     {
  88.                         color:blue;
  89.                     }
  90.  
  91.                     .cb 
  92.                     {
  93.                         text-indent:0px; 
  94.                         margin: 0,1em,0,1em;
  95.                         padding-left:.3em; 
  96.                         font:small Courier; 
  97.                         color:#888888;
  98.                     }
  99.  
  100.                     .ci 
  101.                     {
  102.                         font:small Courier; 
  103.                         color:#888888;
  104.                     }
  105.  
  106.                     pre 
  107.                     {
  108.                         margin:0px; 
  109.                         display:inline;
  110.                     }
  111.                     
  112.                     h5
  113.                     {
  114.                         margin:0px 13px 0px 13px;
  115.                     }
  116.                     
  117.                     button#eBtnClose
  118.                     {
  119.                         position:absolute;
  120.                         bottom:5px;
  121.                         padding-left:10px;
  122.                         padding-right:10px;
  123.                         font:messagebox;
  124.                     }
  125.  
  126.                 </style>
  127.                 <script type="text/jscript">
  128.                     <xsl:comment>
  129.                         <![CDATA[
  130.                             function f( e )
  131.                             {
  132.                                 if( e.className == "ci" ) 
  133.                                 {
  134.                                     if ( e.children(0).innerText.indexOf("\n") > 0 )
  135.                                     {
  136.                                         fix(e, "cb");
  137.                                     }
  138.                                 }
  139.                                 if( e.className == "di" ) 
  140.                                 {
  141.                                     if( e.children(0).innerText.indexOf("\n") > 0 )
  142.                                     {
  143.                                         fix(e, "db");
  144.                                     }
  145.                                 }
  146.                                 e.id = "";
  147.                             }
  148.  
  149.                             function fix( e, cl )
  150.                             {
  151.                                 e.className = cl;
  152.                                 e.style.display = "block";
  153.                                 j = e.parentElement.children(0);
  154.                                 j.className = "c";
  155.                                 k = j.children(0);
  156.                                 k.style.visibility = "visible";
  157.                                 k.href = "javascript:void(0);";
  158.                             }
  159.  
  160.                             function ch( e )
  161.                             {
  162.                                 mark = e.children(0).children(0);
  163.                                 if( mark.innerText == "+" )
  164.                                 {
  165.                                     mark.innerText = "-";
  166.                                     for( var i = 1; i < e.children.length; i++ )
  167.                                     {
  168.                                         e.children(i).style.display = "block";
  169.                                     }
  170.                                 }
  171.                                 else if( mark.innerText == "-" )
  172.                                 {
  173.                                     mark.innerText = "+";
  174.                                     for( var i = 1; i < e.children.length; i++ )
  175.                                     {
  176.                                         e.children(i).style.display="none";
  177.                                     }
  178.                                 }
  179.                             }
  180.  
  181.                             function ch2( e )
  182.                             {
  183.                                 mark = e.children(0).children(0);
  184.                                 contents = e.children(1);
  185.                                 if( mark.innerText == "+" )
  186.                                 {
  187.                                     mark.innerText = "-";
  188.                                     if( contents.className == "db" || contents.className == "cb" )
  189.                                     {
  190.                                         contents.style.display = "block";
  191.                                     }
  192.                                     else
  193.                                     {
  194.                                         contents.style.display = "inline";
  195.                                     }
  196.                                 }
  197.                                 else if(mark.innerText == "-")
  198.                                 {
  199.                                     mark.innerText = "+";
  200.                                     contents.style.display = "none";
  201.                                 }
  202.                             }
  203.  
  204.                             function cl()
  205.                             {
  206.                                 e = window.event.srcElement;
  207.                                 if( e.className != "c" )
  208.                                 {
  209.                                     e = e.parentElement;
  210.                                     if( e.className != "c" )
  211.                                     {
  212.                                         return;
  213.                                     }
  214.                                 }
  215.                                 e = e.parentElement;
  216.                                 if( e.className == "e" )
  217.                                 {
  218.                                     ch( e );
  219.                                     if( e.className == "k" )
  220.                                     ch2( e );
  221.                                 }
  222.                             }
  223.  
  224.                             function ex() 
  225.                             {
  226.                             
  227.                             }
  228.  
  229.                             function h()
  230.                             {
  231.                                 window.status=" ";
  232.                             }
  233.  
  234.                             document.onclick = cl;
  235.                             
  236.                             function Finish()
  237.                             {
  238.                                 self.close();
  239.                             }
  240.                             
  241.                             function ESC_KeyDown()
  242.                             {
  243.                                 if( 27 == event.keyCode )
  244.                                 {
  245.                                     self.close();
  246.                                 }
  247.                             }
  248.  
  249.                         ]]>
  250.                     </xsl:comment>
  251.                 </script>
  252.             </head>
  253.             <body onbeforeunload="window.dialogArguments.g_oXMLDlg = null;" onkeydown="ESC_KeyDown();" class="st">
  254.                 <div style="overflow-y:auto;height:80%;">
  255.                     <h5></h5>
  256.                     <hr style="color:navy;height:1px;margin:0px 13px 0px 13px;" />
  257.                     <xsl:apply-templates />
  258.                 </div>
  259.                 <button id="eBtnClose" onclick="Finish();" style="left:expression( (document.body.clientWidth - eBtnClose.offsetWidth) / 2 );"></button>
  260.             </body>
  261.         </html>
  262.     </xsl:template>
  263.     <!-- Templates for each node type follows.  The output of each template has a similar structure
  264.       to enable script to walk the result tree easily for handling user interaction. -->
  265.  
  266.     <!-- Template for the DOCTYPE declaration.  No way to get the DOCTYPE, so we just put in a placeholder -->
  267.     <xsl:template match="node()[nodeType()=10]">
  268.         <div class="e">
  269.             <span>
  270.                 <span class="b"><xsl:entity-ref name="nbsp"/></span>
  271.                 <span class="d"><!DOCTYPE <xsl:node-name/><I> (View Source for full doctype...)</I>></span>
  272.             </span>
  273.         </div>
  274.     </xsl:template>
  275.  
  276.     <!-- Template for pis not handled elsewhere -->
  277.     <xsl:template match="pi()">
  278.         <div class="e">
  279.         <span class="b"><xsl:entity-ref name="nbsp"/></span>
  280.         <span class="m"><?</span>
  281.         <span class="pi"><xsl:node-name/> <xsl:value-of/></span>
  282.         <span class="m">?></span>
  283.     </div>
  284.     </xsl:template>
  285.  
  286.     <!-- Template for the XML declaration.  Need a separate template because the pseudo-attributes
  287.     are actually exposed as attributes instead of just element content, as in other pis -->
  288.     <xsl:template match="pi('xml')">
  289.         <div class="e">
  290.             <span class="b"><xsl:entity-ref name="nbsp"/></span>
  291.             <span class="m"><?</span>
  292.             <span class="pi">xml <xsl:for-each select="@*"><xsl:node-name/>="<xsl:value-of/>" </xsl:for-each></span>
  293.             <span class="m">?></span>
  294.         </div>
  295.     </xsl:template>
  296.  
  297.     <!-- Template for attributes not handled elsewhere -->
  298.     <xsl:template match="@*" xml:space="preserve">
  299.         <span><xsl:attribute name="class"><xsl:if match="xsl:*/@*">x</xsl:if>t</xsl:attribute> <xsl:node-name/></span>
  300.         <span class="m">="</span>
  301.         <B><xsl:value-of/></B><span class="m">"</span>
  302.     </xsl:template>
  303.  
  304.     <!-- Template for attributes in the xmlns or xml namespace -->
  305.     <xsl:template match="@xmlns:*|@xmlns|@xml:*">
  306.         <span class="ns"> <xsl:node-name/></span>
  307.         <span class="m">="</span>
  308.         <B class="ns"><xsl:value-of/></B>
  309.         <span class="m">"</span>
  310.     </xsl:template>
  311.  
  312.     <!-- Template for attributes in the dt namespace -->
  313.     <xsl:template match="@dt:*|@d2:*">
  314.         <span class="dt"> <xsl:node-name/></span>
  315.         <span class="m">="</span>
  316.         <B class="dt"><xsl:value-of/></B>
  317.         <span class="m">"</span>
  318.     </xsl:template>
  319.  
  320.     <!-- Template for text nodes -->
  321.     <xsl:template match="textNode()">
  322.         <div class="e">
  323.             <span class="b"><xsl:entity-ref name="nbsp"/></span>
  324.             <span class="tx"><xsl:value-of/></span>
  325.         </div>
  326.     </xsl:template>
  327.  
  328.     <!-- Template for comment nodes -->
  329.     <xsl:template match="comment()">
  330.         <div class="k">
  331.             <span>
  332.                 <a class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</a> 
  333.                 <span class="m"><!--</span>
  334.             </span>
  335.             <span id="clean" class="ci"><PRE><xsl:value-of/></PRE></span>
  336.             <span class="b"><xsl:entity-ref name="nbsp"/></span> 
  337.             <span class="m">--></span>
  338.             <script type="text/jscript">
  339.                 f( clean );
  340.             </script>
  341.         </div>
  342.     </xsl:template>
  343.  
  344.     <!-- Template for cdata nodes -->
  345.     <xsl:template match="cdata()">
  346.         <div class="k">
  347.             <span>
  348.                 <A class="b" onclick="return false" onfocus="h()" STYLE="visibility:hidden">-</A> 
  349.                 <span class="m"><![CDATA[</span>
  350.             </span>
  351.             <span id="clean" class="di">
  352.                 <PRE><xsl:value-of/></PRE>
  353.             </span>
  354.             <span class="b"><xsl:entity-ref name="nbsp"/></span> 
  355.             <span class="m">]]></span>
  356.             <script type="text/jscript">
  357.                 f( clean );
  358.             </script>
  359.         </div>
  360.     </xsl:template>
  361.  
  362.     <!-- Template for elements not handled elsewhere (leaf nodes) -->
  363.     <xsl:template match="*">
  364.         <div class="e">
  365.             <div STYLE="margin-left:1em;text-indent:-2em">
  366.                 <span class="b"><xsl:entity-ref name="nbsp"/></span>
  367.                 <span class="m"><</span>
  368.                 <span><xsl:attribute name="class"><xsl:if match="xsl:*">x</xsl:if>t</xsl:attribute><xsl:node-name/></span> 
  369.                 <xsl:apply-templates select="@*"/>
  370.                 <span class="m"> /></span>
  371.             </div>
  372.         </div>
  373.     </xsl:template>
  374.  
  375.     <!-- Template for elements with comment, pi and/or cdata children -->
  376.     <xsl:template match="*[node()]">
  377.         <div class="e">
  378.             <div class="c">
  379.                 <A href="#" onclick="return false" onfocus="h()" class="b">-</A> 
  380.                 <span class="m"><</span>
  381.                 <span><xsl:attribute name="class"><xsl:if match="xsl:*">x</xsl:if>t</xsl:attribute><xsl:node-name/></span>
  382.                 <xsl:apply-templates select="@*"/> 
  383.                 <span class="m">></span>
  384.             </div>
  385.             <div>
  386.                 <xsl:apply-templates/>
  387.                 <div>
  388.                     <span class="b"><xsl:entity-ref name="nbsp"/></span> 
  389.                     <span class="m"></</span>
  390.                     <span><xsl:attribute name="class"><xsl:if match="xsl:*">x</xsl:if>t</xsl:attribute><xsl:node-name/></span>
  391.                     <span class="m">></span>
  392.                 </div>
  393.             </div>
  394.         </div>
  395.     </xsl:template>
  396.  
  397.     <!-- Template for elements with only text children -->
  398.     <xsl:template match="*[textNode()$and$$not$(comment()$or$pi()$or$cdata())]">
  399.         <div class="e">
  400.             <div STYLE="margin-left:1em;text-indent:-2em">
  401.                 <span class="b"><xsl:entity-ref name="nbsp"/></span> 
  402.                 <span class="m"><</span>
  403.                 <span><xsl:attribute name="class"><xsl:if match="xsl:*">x</xsl:if>t</xsl:attribute><xsl:node-name/></span>
  404.                 <xsl:apply-templates select="@*"/>
  405.                 <span class="m">></span>
  406.                 <span class="tx"><xsl:value-of/></span>
  407.                 <span class="m"></</span>
  408.                 <span><xsl:attribute name="class"><xsl:if match="xsl:*">x</xsl:if>t</xsl:attribute><xsl:node-name/></span>
  409.                 <span class="m">></span>
  410.             </div>
  411.         </div>
  412.     </xsl:template>
  413.  
  414.     <!-- Template for elements with element children -->
  415.     <xsl:template match="*[*]">
  416.         <div class="e">
  417.             <div class="c" STYLE="margin-left:1em;text-indent:-2em">
  418.                 <A href="#" onclick="return false" onfocus="h()" class="b">-</A> 
  419.                 <span class="m"><</span>
  420.                 <span><xsl:attribute name="class"><xsl:if match="xsl:*">x</xsl:if>t</xsl:attribute><xsl:node-name/></span>
  421.                 <xsl:apply-templates select="@*"/> 
  422.                 <span class="m">></span>
  423.             </div>
  424.             <div>
  425.                 <xsl:apply-templates/>
  426.                 <div>
  427.                     <span class="b"><xsl:entity-ref name="nbsp"/></span> 
  428.                     <span class="m"></</span>
  429.                     <span><xsl:attribute name="class"><xsl:if match="xsl:*">x</xsl:if>t</xsl:attribute><xsl:node-name/></span>
  430.                     <span class="m">></span>
  431.                 </div>
  432.             </div>
  433.         </div>
  434.     </xsl:template>
  435. </xsl:stylesheet>